import Vue from 'vue'
import Vuex from 'vuex'
import mutations from "./mutations.js"
import getters from "./getters.js"

const state = {
  list: JSON.parse(localStorage.getItem("list")) || [],
  id: localStorage.getItem("id") || 0
}

Vue.use(Vuex)

const store = new Vuex.Store({
  state,
  mutations,
  getters
})

// 3.导出
export default store
